#include <iostream>

// basic template
template<typename T>
class AnimalBase {
	public:
		void action() {
			T::print();
		}
};

// Dog class
class Dog : public AnimalBase<Dog> {
	public:
		static void print() {
			std::cout << "This is dog\n";
		}
};

// Cat class
class Cat : public AnimalBase<Cat> {
	public:
		static void print() {
			std::cout << "This is cat\n";
		}
};

int main() {
	Dog dog;
	Cat cat;

	dog.action();
	cat.action();

	return 0;
}
